package com.fortune.rainshineservice.controller;

import com.fortune.rainshinecommon.base.MsgModel;
import com.fortune.rainshineservice.service.ICbmCityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: rainShine
 * @description: 城市控制器
 * @author: tangyn
 * @create: 2019-05-19
 **/
@RestController
@RequestMapping("/city")
public class CityController {
    @Autowired
    private ICbmCityService iCbmCityService;

    @PostMapping("/getCbmCityList")
    public MsgModel getCbmCityList(){
        return iCbmCityService.getCbmCityList();
    }

    @PostMapping("/getCityNameByCode")
    public String getCityNameByCode(@RequestBody String cityCode){
        return iCbmCityService.getCityNameByCode(cityCode);
    }

    @PostMapping("/getProvinceNameByCode")
    public String getProvinceNameByCode(@RequestBody String provinceCode){
        return iCbmCityService.getProvinceNameByCode(provinceCode);
    }
}
